﻿using System.Web.Mvc;
using System.Web.Routing;

namespace projetoFinal.App_Start
{
    public class RouteConfig
    {
        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

            routes.MapRoute(
                    name:"Cadastro de Pessoa Fisica",
                    url:"Fisica/",
                    defaults: new {Controller="Pagina", action="CadastroFisico"}
                );

            routes.MapRoute(
                   name: "Cadastro de Pessoa Juridica",
                   url: "Juridica/",
                   defaults: new { Controller = "Pagina", action = "CadastroJuridico" }
               );

            routes.MapRoute(
                   name: "Cadastro de Plano",
                   url: "Plano/",
                   defaults: new { Controller = "Pagina", action = "Plano" }
               );

            routes.MapRoute(
                   name: "Cadastro de Contrato",
                   url: "Contrato/",
                   defaults: new { Controller = "Pagina", action = "Contrato" }
               );

            routes.MapRoute(
                   name: "Login",
                   url: "Login/",
                   defaults: new { Controller = "Conta", action = "Login" }
               );

            routes.MapRoute(
                   name: "Validacao de login",
                   url: "Entrar/",
                   defaults: new { Controller = "Conta", action = "ValidaLogin" }
               );

            routes.MapRoute(
                name: "Pagina Principal",
                url: "Home/",
                defaults: new { controller = "Home", action = "Index"}
            );

            //routes.MapRoute(
            //    name: "Página nao encontrada",
            //    url: "Erro/",
            //    defaults: new { controller = "Error"}
            //);

            routes.MapRoute(
                name: "Default",
                url: "{controller}/{action}/{id}",
                defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
            );
        }
    }
}